CHR$ Function ---------------------------------------------------------------------------- Action Returns a one-character string whose ASCII code is the argument. Syntax CHR$( code%) Remarks CHR$ is commonly used to send a special character to the screen or printer. For example, you can send a form feed (CHR$(12)) to clear the screen and return the cursor to the home position. CHR$ also can be used to include a double quotation mark (") in a string. The following line adds a double-quotation-mark character to the beginning and the end of the string. Msg$=CHR$(34)+"Quoted string"+CHR$(34) See Also ASC; Appendix A, "Keyboard Scan Codes and ASCII Character Codes" Example The following example uses CHR$ to display graphics characters in the extended character set and uses these characters to draw boxes on the screen. DEFINT A-Z ' Display two double-sided boxes. CALL DBox(5,22,18,40) CALL DBox(1,4,4,50) END ' SUB procedure to display boxes. ' Parameters. ' Urow%, Ucol%. Row and column of upper-left corner. ' Lrow%, Lcol%. Row and column of lower-right corner. CONST VERT=186, HORZ=205 ' Extended ASCII graphics characters. CONST ULEFTC=201, URIGHTC=187, LLEFTC=200, LRIGHTC=188 SUB DBox (Urow%, Ucol%, Lrow%, Lcol%) STATIC LOCATE Urow%, Ucol% . PRINT CHR$(ULEFTC);' Draw top of box. LOCATE ,Ucol%+1 . PRINT STRING$(Lcol%-Ucol%,CHR$(HORZ)); LOCATE ,Lcol% . PRINT CHR$(URIGHTC); FOR I=Urow%+1 TO Lrow%-1' Draw body of box. LOCATE I,Ucol% . PRINT CHR$(VERT); LOCATE ,Lcol% . PRINT CHR$(VERT); NEXT I LOCATE Lrow%, Ucol% . PRINT CHR$(LLEFTC);' Draw bottom of box. LOCATE ,Ucol%+1 . PRINT STRING$(Lcol%-Ucol%,CHR$(HORZ)); LOCATE ,Lcol% . PRINT CHR$(LRIGHTC); END SUB